revBrowserCallScript
Type
function
Summary
Calls a web script function in the current browser object
Syntax
revBrowserCallScript(<instanceId>, <functionName> [, <functionParameter> ...])
Description
Use the revBrowserCallScript function to call a web script function in the context of the current document in the specified browser object.
The revBrowserCallScript function currently searches for and calls JScript functions on Windows and JavaScript functions on OS X. If the function is not found or calling it is not successful, then an "error in script" exception is thrown.
that the arguments passed to the function are internally treated as NULL-terminated strings. This means that binary data cannot be passed, it must first be encoded somehow. This is typically done using the base64Encode function.
If you want to execute some arbitrary JavaScript, rather than call an existing function, use the revBrowserExecuteScript function instead.
The revBrowserCallScript function will return whatever the function called returned.
For general information on using the browser library, please see the notes in the revBrowserOpen function reference.
Parameters
Name | Type | Description |
---|---|---|
instanceId | The integer identifier of a browser object | |
functionName | The name of the web script function to call | |
functionParameter | One or more optional parameters may contain the arguments to pass to the function. |
Examples
get revBrowserCallScript(sBrowserId, "swapImages")
get revBrowserCallscript(sBrowserId, "displayTable", tHeader, tFooter)
Related
glossary: function
function: revBrowserExecuteScript, base64Encode, revBrowserOpen
Compatibility and Support
Introduced
LiveCode 3.5
OS
mac
windows
Platforms
desktop